
#include "main_container.h"

#include <stdio.h>
#include "generic_table.h"

MainContainer::MainContainer()
{
#ifdef TRACE
	LogTrace = NULL;
#endif

#ifdef DEBUG
	LogDebug = NULL;
#endif

	ErrorWarningReport = NULL;
	Flags = NULL;
	Loader = NULL;
	LoadedFiles = NULL;
//	LoadedFilesCount = -1;
	SyntaxParser = NULL;
	SyntaxTree = NULL;
	Semantics = NULL;
}


MainContainer::~MainContainer()
{
#ifdef TRACE
	if(LogTrace != NULL)
	{
		delete LogTrace;
		LogTrace = NULL;
	}
#endif

#ifdef DEBUG
	if(LogDebug != NULL)
	{
		delete LogDebug;
		LogDebug = NULL;
	}
#endif

	if(ErrorWarningReport != NULL)
	{
		delete ErrorWarningReport;
		ErrorWarningReport = NULL;
	}

	if(Flags != NULL)
	{
		delete Flags;
		Flags = NULL;
	}

	if(Loader != NULL)
	{
		delete Loader;
		Loader = NULL;
	}

	if(LoadedFiles != NULL)
	{
		delete LoadedFiles;
		LoadedFiles = NULL;
	}

	if(SyntaxParser != NULL)
	{
		delete SyntaxParser;
		SyntaxParser = NULL;
	}
	
	if(SyntaxTree != NULL)
	{
		delete SyntaxTree;
		SyntaxTree = NULL;
	}
	
	if(Semantics != NULL)
	{
		delete Semantics;
		Semantics = NULL;
	}
	
}

